<template>
  <view class="my-container">
    <!-- 没有 token 显示登录 -->
    <my-login v-if="!token"></my-login>

    <!-- 有 token 显示用户信息 -->
    <my-userinfo v-else></my-userinfo>
  </view>
</template>
<script>
import MyUserinfo from '@/components/my-userinfo.vue'
import MyLogin from '@/components/my-login.vue'
import { mapState } from 'vuex'
export default {
  data() {
    return {}
  },
  components: {
    MyUserinfo,
    MyLogin
  },
  computed: {
    ...mapState('user', ['token'])
  }
}
</script>

<style lang="scss">
page,
.my-container {
  height: 100%;
}
</style>
